<template>
  <div>
    <p>测试兄弟元素之间传值</p>
    <p>{{msg}}</p>
    <p @click="test">按钮</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: 1
    };
  },
  created() {
    console.log("------created--------");
  },
  mounted() {
    console.log("------mouted--------");
  },
  methods: {
    test() {
      this.msg = 2;
      this.$bus.emit("todo", this.msg);
      this.$bus.emit("once");
    }
  }
};
</script>

<style>
</style>